package com.mtiiot.fstcpserver.mq.kafka.insplatform;


import kafka.producer.Partitioner;
import kafka.utils.VerifiableProperties;

/**
 * Created by Administrator on 2016/7/26.
 */
public class InstruPartitioner implements Partitioner {
    public InstruPartitioner(VerifiableProperties props) {
    }

    public int partition(Object key, int partitionCount) {
        return Math.abs(Integer.valueOf(((String)key).hashCode()).intValue() % partitionCount);
    }
}
